package com.edu.base.ums.collectRecord.service.impl;

import com.edu.base.ums.collectRecord.domain.ClsMemberCollectRecord;
import com.edu.base.ums.collectRecord.mapper.ClsMemberCollectRecordMapper;
import com.edu.base.ums.collectRecord.service.IClsMemberCollectRecordService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 会员收藏Service业务层处理
 * 
 * @author admin
 * @date 2021-07-21
 */
@Service
public class ClsMemberCollectRecordServiceImpl implements IClsMemberCollectRecordService 
{
    @Autowired
    private ClsMemberCollectRecordMapper clsMemberCollectRecordMapper;

    /**
     * 查询会员收藏
     * 
     * @param id 会员收藏ID
     * @return 会员收藏
     */
    @Override
    public ClsMemberCollectRecord selectClsMemberCollectRecordById(String id)
    {
        return clsMemberCollectRecordMapper.selectClsMemberCollectRecordById(id);
    }

    /**
     * 查询会员收藏列表
     * 
     * @param clsMemberCollectRecord 会员收藏
     * @return 会员收藏
     */
    @Override
    public List<ClsMemberCollectRecord> selectClsMemberCollectRecordList(ClsMemberCollectRecord clsMemberCollectRecord)
    {
        return clsMemberCollectRecordMapper.selectClsMemberCollectRecordList(clsMemberCollectRecord);
    }

    @Override
    public List<ClsMemberCollectRecord> selectMemberRecordList(ClsMemberCollectRecord clsMemberCollectRecord) {
        return clsMemberCollectRecordMapper.selectMemberRecordList(clsMemberCollectRecord);
    }

    /**
     * 新增会员收藏
     * 
     * @param clsMemberCollectRecord 会员收藏
     * @return 结果
     */
    @Override
    public int insertClsMemberCollectRecord(ClsMemberCollectRecord clsMemberCollectRecord)
    {
        clsMemberCollectRecord.setCreateTime(DateUtils.getNowDate());
        return clsMemberCollectRecordMapper.insertClsMemberCollectRecord(clsMemberCollectRecord);
    }

    /**
     * 修改会员收藏
     * 
     * @param clsMemberCollectRecord 会员收藏
     * @return 结果
     */
    @Override
    public int updateClsMemberCollectRecord(ClsMemberCollectRecord clsMemberCollectRecord)
    {
        return clsMemberCollectRecordMapper.updateClsMemberCollectRecord(clsMemberCollectRecord);
    }

    /**
     * 批量删除会员收藏
     * 
     * @param ids 需要删除的会员收藏ID
     * @return 结果
     */
    @Override
    public int deleteClsMemberCollectRecordByIds(String[] ids)
    {
        return clsMemberCollectRecordMapper.deleteClsMemberCollectRecordByIds(ids);
    }

    /**
     * 删除会员收藏信息
     * 
     * @param id 会员收藏ID
     * @return 结果
     */
    @Override
    public int deleteClsMemberCollectRecordById(String id)
    {
        return clsMemberCollectRecordMapper.deleteClsMemberCollectRecordById(id);
    }

	@Override
	public int deleteCollectOrRecordByCourseIds(String[] courseIds, String memberId) {
		return clsMemberCollectRecordMapper.deleteCollectOrRecordByCourseIds(courseIds,memberId);
	}
}
